package com.ml.mall.api.log;


import com.ml.mall.api.BaseController;
import com.ml.mall.bean.base.ApiRestResult;
import com.ml.mall.bean.req.log.ExceptionLogQueryDto;
import com.ml.mall.consts.PermissionConst;
import com.ml.mall.service.log.ExceptionLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author kyyang
 * Created 2021-01-07
 */

@RestController
@RequestMapping("/exception_log")
@Api(tags = "异常日志")
public class ExceptionLogController extends BaseController {

    @Autowired
    private ExceptionLogService exceptionLogService;

    @RequestMapping(method = RequestMethod.POST, path = "/query")
    @ApiOperation("查询异常日志")
//  @RequiresPermissions(PermissionConst.EXCEPTION_LOG_QUERY)//未发现调用
    public ApiRestResult exceptionQuery(@RequestBody @Valid ExceptionLogQueryDto exceptionLogQueryDto) {
        return ApiRestResult.ok(exceptionLogService.exceptionQuery(exceptionLogQueryDto));
    }

}
